//TODO a(1)
function a1(module, exports, a) {


    !function () {
        var e = a(2), t = a(3), i = a(4), s = a(6);
        if ("undefined" == typeof LETV_PLAYER && (window.LETV_PLAYER = {}), "undefined" == typeof LETV_PLAYER.Player) {
            var r = a(7), na15 = a(15);
            LETV_PLAYER.playerInterface || (LETV_PLAYER.playerInterface = a(66));
            var o = 1, l = "http://player.hz.letv.com/hzplayer.swf/open", d = "https://player.letvcdn.com/lc05_p/201612/27/18/15/18/newplayer/LetvPlayer.swf", h = {
                containerId: !0,
                isH5: !0,
                playerId: !0,
                debug: !0,
                host: !0,
                width: !0,
                height: !0,
                wmode: !0,
                flashUrl: !0,
                event: !0,
                "interface": !0
            }, c = {
                ark: !0,
                p1: !0,
                p2: !0
            }, p = "U2FsdGVkX19BsgrtK3jYsXlDJGOX6pwOLazJVSp/qfdTN7DgLv8XDUYqgv+9ove8", u = {
                preload: 1,
                autoMute: 0,
                forceCallback: 1,
                barrage: 0,
                camera: 0,
                isHttps: 0
            };
            LETV_PLAYER.CONFIG = {lan: "cn", region: "cn"};
            var g = function (e) {
                t.merge(LETV_PLAYER.CONFIG, e)
            }, fplayer2 = function (e, t) {
                if (e = e || {}, t = t || p, !e.containerId)return void alert("The containerId must be needed");
                if (this.cont = s("#" + e.containerId), !this.cont.length)return void alert("Can't find the dom which id is " + e.containerId);
                if (!e.vid)return void this._showErr("The vid must be needed");
                if (e = this._initOptions(e, t)) {
                    var a = this._initFlashVar(e);
                    this.config = {
                        isH5: e.isH5,
                        playerId: e.playerId,
                        cont: e.containerId,
                        flashUrl: e.flashUrl || (e.isHttps ? d : l),
                        option: {w: e.width || "100%", h: e.height || "100%", wmode: e.wmode},
                        flashvar: a
                    }, this.player = this.load()
                }
            };
            fplayer2.prototype = {
                splatIdList: ["101", "304", "301", "1614"],
                regionList: ["cn", "us", "hk"],
                playId: function (e, t) {
                    try {
                        this.player.isH5 ? this.player.playNewId(e, t) : this.player.playNewId(e)
                    } catch (a) {
                    }
                },
                startUp: function () {
                    try {
                        this.player.isH5 ? this.player.resumeVideo() : this.player.startUp()
                    } catch (e) {
                    }
                },
                pause: function () {
                    try {
                        this.player.pauseVideo()
                    } catch (e) {
                    }
                },
                play: function () {
                    try {
                        this.player.resumeVideo()
                    } catch (e) {
                    }
                },
                pushBarrage: function (e) {
                    try {
                        this.player.pushBarrageData(e)
                    } catch (t) {
                    }
                },
                seek: function (e) {
                    try {
                        this.player.seekTo(e)
                    } catch (t) {
                    }
                },
                loginStateChange: function () {
                    try {
                        this.player.setVip()
                    } catch (e) {
                    }
                },
                changeDefi: function (e) {
                    try {
                        this.player.changeDefi(e)
                    } catch (t) {
                    }
                },
                setSize: function (e, t) {
                    if (this.cont.width(e), this.cont.height(t), this.player.isH5)try {
                        this.player.resize()
                    } catch (a) {
                    }
                },
                setChangeInteractive: function (e) {
                    try {
                        this.player.setChangeInteractive(e)
                    } catch (t) {
                    }
                },
                setFullScreen: function (e) {
                    try {
                        this.player.changeFullScreen(e)
                    } catch (t) {
                    }
                },
                setChangeBarrage: function (e) {
                    try {
                        this.player.setChangeBarrage(e)
                    } catch (t) {
                    }
                },
                setEffectBarrage: function (e) {
                    try {
                        this.player.setEffectBarrage(e)
                    } catch (t) {
                    }
                },
                getVideoInfo: function () {
                    try {
                        var e;
                        return e = this.player.isH5 ? this.player.getVideoInfo() : this.player.getVideoSetting(), {
                            vid: e.vid,
                            pid: e.pid,
                            cid: e.cid,
                            nextvid: e.nextvid,
                            duration: e.duration,
                            title: e.title
                        }
                    } catch (t) {
                        return {}
                    }
                },
                getCurrentState: function () {
                    try {
                        var e, t;
                        return this.player.isH5 ? (e = this.player.getCurrTime(), t = this.player.getFullScreenState()) : e = this.player.getVideoTime(), {
                            curTime: e,
                            fullState: t
                        }
                    } catch (a) {
                        return {curTime: 0, fullState: 0}
                    }
                },
                addGoodsSuccess: function (e) {
                    this.player.isH5 || this.player.addGoodsSuccess(e)
                },
                getGoodsUrl: function (e) {
                    this.player.isH5 || this.player.getGoodsUrl(e)
                },
                load: function () {
                    var t, a = this.config;
                    return a.isH5 ? (t = new na15(a), t.isH5 = !0) : (a.option.wmode = a.option.wmode || (e.safari ? "gpu" : "opaque"), a.option.id = "www_player_" + this.config.playerId, t = new r(a.cont, a.option, a.flashvar, a.flashUrl || l, [10, 0, 0])), t
                },
                reload: function (e) {
                    e && (this.config.flashvar = this.config.flashvar.replace(/vid=(\d+)/, "vid=" + e));
                    try {
                        this.config.isH5 && this.player.destroy(), this.player = this.load()
                    } catch (t) {
                    }
                },
                _initOptions: function (a, s) {
                    if (s = i.getAPIKey(s), "" == s || "error" == s)return this._showErr("The key is not available"), null;
                    for (var r = s.split("&"), n = {}, l = 0, d = r.length; l < d; l++) {
                        var h = r[l].split("=");
                        2 == h.length && (n[h[0]] = h[1])
                    }
                    n.host = n.host || "", /(letv\.com|le\.com)/.test(n.host) && (n.host = "(" + n.host + "|" + n.host.replace(RegExp.$1, "letv.com" == RegExp.$1 ? "le.com" : "letv.com") + ")");
                    var p = new RegExp(n.host.replace(/\./g, "\\."), "i");
                    if (1 == n.debug) alert("此key仅供开发调试使用，正式线上请联系yangkexin@letv.com或qq群369063801获取正式秘钥"); else if (!n.host || !p.test(location.hostname))return void this._showErr("This hostname does not have authority to use LETV Player SDK");
                    if (a.splatId && t.arrayIndexOf(this.splatIdList, a.splatId.toString()) < 0)return void this._showErr("This splatId does not supported");
                    if (LETV_PLAYER.CONFIG.region && t.arrayIndexOf(this.regionList, LETV_PLAYER.CONFIG.region) < 0)return void this._showErr("This region does not supported");
                    for (var g in c)n[g] || (n[g] = "limited");
                    for (var f in n)"limited" == n[f] ? "undefined" != typeof a[f] && delete a[f] : "nolimited" != n[f] && (a[f] = n[f]);
                    return a = t.merge(a, u, !0), "H5" == a.playerType ? a.isH5 = 1 : "flash" == a.playerType ? a.isH5 = 0 : a.isH5 = e.Android || e.iPad || e.iPod || e.iPhone || e.mac && e.safari || e.wph || e.ps, a.p1 = a.p1 || (a.isH5 ? "0" : "1"), a.p2 = a.p2 || (a.isH5 ? "MPlayer" == a.pname ? "04" : "06" : "10"), a.forceCDN = 1, a.lan = a.lan || LETV_PLAYER.CONFIG.lan, a.region = LETV_PLAYER.CONFIG.region, a.playerId = o++, a
                },
                _initFlashVar: function (e) {
                    var a = {
                        getCookie: function (e) {
                            return t.getCookie(e)
                        }
                    };
                    e.event = e.event || {}, e["interface"] = t.merge(e["interface"] || {}, a);
                    var i = [], s = this, r = "vjs_callback_" + ((new Date).getTime() + "" + Math.floor(100 * Math.random()));
                    window[r] = function (t, a) {
                        var i = s._getCallbackName(t);
                        if ("function" == typeof e["interface"][i])return e["interface"][i](a);
                        if ("function" == typeof LETV_PLAYER.playerInterface[i])return LETV_PLAYER.playerInterface[i](a);
                        var r = e.event[i];
                        return r ? r(t, a) : e.event.defaultFun && e.event.defaultFun(t, a)
                    }, e.callbackJs = r;
                    for (var n in e)h[n] || "undefined" == typeof e[n] || i.push(n + "=" + e[n]);
                    return i.push("hostnamestr=" + (/letv\.com/.test(location.hostname) ? "letv" : "le")), i.join("&")
                },
                _showErr: function (e) {
                    var t = this.cont.height();
                    this.cont[0].innerHTML = '<div style="text-align: center;line-height: ' + t + "px;height:" + t + 'px">' + e + "</div>"
                },
                _getCallbackName: function (e) {
                    var t = "";
                    switch (e) {
                        case"PLAYER_INIT":
                            t = "onPlayerInit";
                            break;
                        case"PLAYER_VIDEO_PLAY":
                            t = "onPlayerVideoPlay";
                            break;
                        case"PLAYER_SEEK":
                            t = "onPlayerSeek";
                            break;
                        case"PLAYER_VIDEO_PAUSE":
                            t = "onPlayerVideoPause";
                            break;
                        case"PLAYER_VIDEO_RESUME":
                            t = "onPlayerVideoResume";
                            break;
                        case"PLAYER_TIMEUPDATE":
                            t = "onPlayerTimeupdate";
                            break;
                        case"PLAYER_VIDEO_COMPLETE":
                            t = "onPlayerVideoComplete";
                            break;
                        case"PLAYER_PLAY_NEXT":
                            t = "onPlayerPlayNext";
                            break;
                        case"PLAYER_ERROR":
                            t = "onPlayerPlayError";
                            break;
                        case"PLAYER_FIRSTLOOK":
                            t = "onFirstLook";
                            break;
                        case"appGuideEnd":
                            t = "onAppguideEnd";
                            break;
                        case"displayTrylook":
                            t = "onDisplayTrylook";
                            break;
                        case"CHANGE_FULLSCREEN":
                            t = "onChangeFullscreen";
                            break;
                        case"APP_GUIDE":
                            t = "onAppGuide";
                            break;
                        default:
                            t = e
                    }
                    return t
                }
            }, LETV_PLAYER.config = g, LETV_PLAYER.Player = fplayer2
        }
    }()
}
